package cn.tedu.boot4.controller;

import cn.tedu.boot4.entity.Emp;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @RequestMapping("/helloAxios")
    public String helloAxios(String info){
        return "测试成功"+info;
    }

    //如果客户端传递的参数是以js中的自定义对象的形式, 则需要使用@RequestBoby注解
    @RequestMapping("/helloPost")
    public String helloPost(@RequestBody Emp emp){
        System.out.println("emp = " + emp);

        return "post测试成功";
    }


}
